package com.mmx.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.mmx.domain.entity.FlowTask;
import com.mmx.mapper.FlowTaskMapper;
import com.mmx.service.TaskService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @desc: 流程任务业务实现
 * @author: liushuai
 * @date: 2023/2/16 15:45
 */
@Service
public class TaskServiceImpl implements TaskService {

    @Resource
    private FlowTaskMapper flowTaskMapper;

    @Override
    public void insertTaskBatch(List<FlowTask> tasks) {
        if(CollectionUtil.isNotEmpty(tasks)){
            return;
        }
        flowTaskMapper.insertTaskBatch(tasks);
    }

    @Override
    public FlowTask selectTaskByTaskId(Long taskId) {
        if(ObjectUtil.isNull(taskId)){
            return null;
        }
        FlowTask flowTask =  flowTaskMapper.selectTaskByTaskId(taskId);
        return flowTask;
    }
}
